package org.carrot2.examples.clustering;

import java.util.ArrayList;

import org.carrot2.examples.ConsoleFormatter;
import org.carrot2.examples.clustering.coOccurence.entity;
import org.xmlParser.typeOf;

public class debug {

		
		public ConsoleFormatter abc;
	    //public static void main(String args[]) throws Exception
		public void clusterDocuments(String Q, int L, String on, String source, boolean postProcessingCluster, boolean postProcessingCapCount, boolean intent, int intentLimit,float postClusterCoverage,boolean reMerge,boolean galleries, boolean postProcess,boolean logLookup, boolean time,long month,long date,long hours) throws Exception 
	    {        
	    	
	    	boolean queryType;		//to check if the specified query lies in the whitelist/stop list of some specfic queries
	    	StringBuffer ret=new StringBuffer();
	            	
        
            typeOf qType =new typeOf();
            String qintent=qType.predictIntent(Q);
            // not a normal keyword query make a blank guess run normal execution
	                	
	        System.out.println("keyord not normal:: no such specified type");
	        debug1( Q,  L,  on,  source, postProcessingCluster, postProcessingCapCount,  intent,  intentLimit, postClusterCoverage, reMerge, galleries,postProcess,logLookup);
	        System.out.println(ret.length());
	        
	        	            
	    	    
	            
	            
	    }
		
		
		
		public void debug1(String Q, int L, String on, String source, boolean postProcessingCluster, boolean postProcessingCapCount, boolean intent, int intentLimit,float postClusterCoverage,boolean reMerge,boolean galleries, boolean postProcess,boolean logLookup)throws Exception
		{
			
		
		    String query=Q;
            int limit=L;
            
			StringBuffer ret=new StringBuffer();
			
            URLConnectionReader obj = new URLConnectionReader(query,limit,intent);
            
            ArrayList<ArrayList<String>> data1=obj.xmlToDocArray(on, source, intentLimit);
            
            
            ArrayList<String> titles= new ArrayList<String>();
            
            
            for (ArrayList<String> row : data1)
            {
                //documents.add(new Document(row[1], row[2], row[0]));
            	
            	titles.add(row.get(2));
            	if(row.get(2).toLowerCase().indexOf("meeting")>=0)
            		System.out.println(row.get(2));
            	
            }
            
            coOccurence obj1=new coOccurence();
            
            ArrayList<coOccurence.entity> abc=obj1.coOccuringWordsArrayList(titles);
            
            System.out.print("::  [");
    		for(entity obj2:abc){
    			System.out.print(obj2.str+" = " +obj2.val+", ");
    		}
    		System.out.println("]");
            
            
            

            /* A controller to manage the processing pipeline. */
            
            
                        		
		}
			
}
